home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmMain
- BorderStyle = 0 'None
- ClientHeight = 5490
- ClientLeft = 1575
- ClientTop = 3465
- ClientWidth = 7350
- ControlBox = 0 'False
- Height = 5895
- Icon = 0
- Left = 1515
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5490
- ScaleWidth = 7350
- Top = 3120
- Width = 7470
- WindowState = 2 'Maximized
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 0
- Left = 510
- Picture = FRMMAIN.FRX:0000
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 19
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 1
- Left = 1500
- Picture = FRMMAIN.FRX:115A
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 18
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 2
- Left = 2490
- Picture = FRMMAIN.FRX:22B4
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 17
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 3
- Left = 510
- Picture = FRMMAIN.FRX:340E
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 16
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 4
- Left = 1500
- Picture = FRMMAIN.FRX:4568
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 15
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 5
- Left = 2490
- Picture = FRMMAIN.FRX:56C2
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 14
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 6
- Left = 510
- Picture = FRMMAIN.FRX:681C
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 13
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 7
- Left = 1500
- Picture = FRMMAIN.FRX:7976
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 12
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pTop
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 8
- Left = 2490
- Picture = FRMMAIN.FRX:8AD0
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 11
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 0
- Left = 3480
- Picture = FRMMAIN.FRX:9C2A
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 10
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 1
- Left = 4470
- Picture = FRMMAIN.FRX:A9D4
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 9
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 2
- Left = 5460
- Picture = FRMMAIN.FRX:B77E
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 8
- Top = 2190
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 3
- Left = 3480
- Picture = FRMMAIN.FRX:C528
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 7
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 4
- Left = 4470
- Picture = FRMMAIN.FRX:D2D2
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 6
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 5
- Left = 5460
- Picture = FRMMAIN.FRX:E07C
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 5
- Top = 3120
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 6
- Left = 3480
- Picture = FRMMAIN.FRX:EE26
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 4
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 7
- Left = 4470
- Picture = FRMMAIN.FRX:FBD0
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 3
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pMask
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 840
- Index = 8
- Left = 5460
- Picture = FRMMAIN.FRX:1097A
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 2
- Top = 4050
- Visible = 0 'False
- Width = 900
- End
- Begin PictureBox pSave
- BorderStyle = 0 'None
- ClipControls = 0 'False
- Height = 840
- Left = 0
- ScaleHeight = 840
- ScaleWidth = 900
- TabIndex = 1
- Top = 0
- Visible = 0 'False
- Width = 900
- End
- Begin Timer Timer1
- Interval = 50
- Left = 5310
- Top = 150
- End
- Begin PictureBox picSaver
- AutoRedraw = -1 'True
- ClipControls = 0 'False
- Height = 1050
- Left = 2145
- ScaleHeight = 1020
- ScaleWidth = 2370
- TabIndex = 0
- Top = 855
- Width = 2400
- End
- End
-
- Sub Form_Load ()
-
- 'This variable serves as a flag to avoid the screensaver
- 'from ending when the form paints.
- 'The paint event causes the mouse_move event if the
- 'mousepointer is on the form
- firsttime% = True
-
- 'Hide the mouse pointer
- Res = ShowCursor(False)
-
- 'make sure window is full screen
- Me.WindowState = 2
-
- 'Allow our temporary picture box to be drawn on
- pSave.AutoRedraw = True
-
- End Sub
-
- Sub picSaver_Click ()
-
- ExitNice
-
- End Sub
-
- Sub picSaver_DblClick ()
-
- ExitNice
-
- End Sub
-
- Sub picSaver_KeyDown (KeyCode As Integer, Shift As Integer)
-
- ExitNice
-
- End Sub
-
- Sub picSaver_KeyPress (KeyAscii As Integer)
-
- ExitNice
-
- End Sub
-
- Sub picSaver_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- ExitNice
-
- End Sub
-
- Sub picSaver_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- Static OldX, OldY
-
- 'We use this flag to make sure the screen saver
- 'doesn't end when the form initially paints itself,
- 'causing a Mouse_Move event
- If firsttime% Then
- OldX = X
- OldY = Y
- firsttime% = False
- End If
-
- If OldX <> X Or OldY <> Y Then
- ExitNice
- End If
-
- End Sub
-
- Sub Timer1_Timer ()
-
- Dim dummy%
-
- Dim hDestDC%, nWidth%, nHeight%, hPicDC%, hMaskDC%, dwRop&
- Dim hSaveDC%
-
- Static OldX%, OldY%, SkipX%, SkipY%
- Static X%, Y%, reverseX%, reverseY%, captured%
-
- 'Randomize the initial position so the top always
- 'starts at a different position
- Randomize
- If Not captured% Then
- X% = Int(((Me.ScaleWidth + 1) * Rnd) / Screen.TwipsPerPixelX)
- Y% = Int(((Me.ScaleHeight + 1) * Rnd) / Screen.TwipsPerPixelY)
- OldX% = X%
- OldY% = Y%
- End If
-
- 'Increment our picture and mask indexes
- picCount% = picCount% + 1
-
- 'If we've reached the last picture, restart
- If picCount% = 9 Then picCount% = 0
-
- 'Get handles for all picture boxes involved
- hDestDC% = picSaver.hDC
- hPicDC% = pTop(picCount%).hDC
- hMaskDC% = pMask(picCount%).hDC
- hSaveDC% = pSave.hDC
-
- nWidth% = pTop(picCount%).ScaleWidth / Screen.TwipsPerPixelX
- nHeight% = pTop(picCount%).ScaleHeight / Screen.TwipsPerPixelY
-
- 'I've used 120 steps for the top to cruise the entire
- 'screen. Less steps means faster.
- SkipX% = picSaver.ScaleWidth / 120 / Screen.TwipsPerPixelX
- SkipY% = picSaver.ScaleHeight / 120 / Screen.TwipsPerPixelY
-
- 'Make sure we save the original screen's
- 'background in our provisional picture box
- If Not captured% Then
- dwRop& = SRCCOPY
- dummy% = BitBlt%(hSaveDC%, 0, 0, nWidth%, nHeight%, hDestDC%, X%, Y%, dwRop&)
- 'We've saved it, so we may continue
- captured% = True
- End If
-
- 'Restore the background to its original state (note the plus and minus 2
- 'offset used with OldX% and OldY%: this "bends" the screen)
- dwRop& = SRCCOPY
- dummy% = BitBlt%(hDestDC%, OldX% + 2, OldY% - 2, nWidth%, nHeight%, hSaveDC%, 0, 0, dwRop&)
-
- 'Save the new position into the provisional picture
- 'box so we may restore it later with the previous step
- dwRop& = SRCCOPY
- dummy% = BitBlt%(hSaveDC%, 0, 0, nWidth%, nHeight%, hDestDC%, X%, Y%, dwRop&)
-
- 'Copy (SRCAND) the mask into the new position
- dwRop& = SRCAND
- dummy% = BitBlt%(hDestDC%, X%, Y%, nWidth%, nHeight%, hMaskDC%, 0, 0, dwRop&)
-
- 'Copy (SRCINVERT) then picture into the new position
- dwRop& = SRCINVERT
- dummy% = BitBlt%(hDestDC%, X%, Y%, nWidth%, nHeight%, hPicDC%, 0, 0, dwRop&)
-
- 'Remember this position for next pass
- OldX% = X%
- OldY% = Y%
-
- 'Have we reached the end of the screen?
- If X% >= (picSaver.ScaleWidth - pSave.ScaleWidth) / Screen.TwipsPerPixelX Then
- reverseX% = True
- ElseIf X% <= 0 Then
- reverseX% = False
- End If
-
- 'Have we reached the bottom of the screen?
- If Y% >= (picSaver.ScaleHeight - pSave.ScaleHeight) / Screen.TwipsPerPixelY Then
- reverseY% = True
- ElseIf Y% <= 0 Then
- reverseY% = False
- End If
-
- 'Get a new position
- If reverseX% Then
- X% = X% - SkipX%
- Else
- X% = X% + SkipX%
- End If
-
- If reverseY% Then
- Y% = Y% - SkipY%
- Else
- Y% = Y% + SkipY%
- End If
-
- End Sub
-
-